package cocurrency.waitnotify;

/**
 * Created by luzl on 4/6/2017.
 */
public class NotifyTest extends Thread {
    private Lock lock;
    public NotifyTest(Lock lock){
        this.lock=lock;
    }
    public void run(){
        synchronized (lock){
            int i=0;
            while(i<10){
                i++;
                lock.increase();
                System.out.println(Thread.currentThread().getName()+" count is : "+lock.getCount().intValue());
            }
            lock.notify();
        }
    }
}
